package com.biz.primus.ms.search.api;

import com.biz.primus.base.vo.SearchResult;
import com.biz.primus.model.depot.vo.DepotSearchResultVo;
import com.biz.primus.model.depot.vo.SearchDepotConditionVo;
import com.biz.primus.ms.base.api.BaseApiController;
import com.biz.primus.ms.search.service.DepotSearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * DepotSearchApiController
 *
 * @author JKLiues
 * @date 2017年11月18日
 */
@RestController
@RequestMapping("depotSearchService")
@Api("门店搜索服务")
public class DepotSearchApiController extends BaseApiController {

    private final DepotSearchService depotSearchService;

    @Autowired
    public DepotSearchApiController(DepotSearchService depotSearchService) {
        this.depotSearchService = depotSearchService;
    }


    @ApiOperation("门店搜索")
    @PostMapping("searchDepot")
    public SearchResult<DepotSearchResultVo> searchDepot(@RequestBody SearchDepotConditionVo vo) {
        return depotSearchService.searchDepot(vo);
    }
}